package cn.xiuxius.embedded.command.converter;

import cn.xiuxius.embedded.model.Uart2PinFlashOptionType;
import picocli.CommandLine;

public class Uart2PinModeConverter implements CommandLine.ITypeConverter<Uart2PinFlashOptionType> {
    @Override
    public Uart2PinFlashOptionType convert(String value) {
        try {
            return Uart2PinFlashOptionType.from(value.trim().toUpperCase());
        } catch (Exception e) {
            throw new CommandLine.TypeConversionException("Invalid Uart2PinMode: " + value);
        }
    }
}

